<#-- 导入模版定义文件-->
<#include "../template/template_editPage.ftl">
<@edit title="充值业务">
<body>
<style type="text/css">
    .input {
        width: 300px;
        height: 30px;
        font-size: 23px;
    / / line-height : 20;
    }
</style>
<script type="text/javascript">
    $(function () {
        if($("#nation").val()=="true"){
            if(confirm("没有找到本地通道，是否使用全国通道充值？"))
                $("#submits").click();
            else
            $("#resets").click();
             }

    });
    function checkNumber() {
        $("#numberSpan").html("");
        var ereg = /^((13[0-9])|(15[0-3,5-9])|(18[0-9]))\d{8}$/;
        var num = $("#number").val().trim();
        if (!ereg.test(num)) {
            $("#numberSpan").html("请输入正确的手机号码...");
            return false;
        } else {
            $.ajax({
                type:"POST",
                url:"${web_base}/recharge/phone_recharge!findMsg.htm",
                data:"phone=" + num,
                success:function (msg) {
                    var obj = eval('(' + msg + ')');
                    $("#citySpan").html(obj.phoneArea.type + "  " + obj.phoneArea.province + "-" + obj.phoneArea.city);
                }
            });
            return true;
        }
    }
    //检查金额
    function checkPrice() {
        $("#priceSpan").html("");
        var ereg = /^[1-9]\d{0,2}$/;
        var price = $("#price").val().trim();
        if (!ereg.test(price)) {
            $("#priceSpan").html("请输入正确的金额...");
            return false;
        } else {
            return true;
        }
    }
    //提交检查
    function submits() {
        return checkNumber() && checkPrice();
    }
		<#if actionErrors??&&(actionErrors?size > 0)>
			$.dialog({type: "warn", content: "<#list errorMessages as list>${list}<br></#list>",
			 modal: true, autoCloseTime: 3000});
		</#if>
</script>
<form action="${web_base}/recharge/phone_recharge!recharge.htm">
    <div
            style="width: 700px; height: 400px; border: solid 2px blue; position: relative;left:100px;top:60px;">
        <div style="position: absolute; top: 20px; left: 20px;">
            <span style="font-size:20px;">缴费号码:</span>
            <input id="number" class="input" type="text" name="r.moblie" <#if r??&&r.moblie??> value="${r.moblie}" </#if> onblur="checkNumber();"/>
            &nbsp;&nbsp;
            <input type="button" value="余额"/>
            <span id="numberSpan" style="color:red;"></span>
        </div>
        <div style="position: absolute; top: 60px; left: 110px;">
            机主姓名:
            当前余额:
            号码归属:<span id="citySpan" style="color:blue;"></span>
           	<input id="phoneType" type="hidden" name="r.phoneType" value="02"/>
        </div>
        <div style="position: absolute; top: 100px; left: 110px;">
            <input type="radio" name="r.operationCode" value="000001"/>联通固话
            <input type="radio" name="r.operationCode" value="000002"/>移动固话
            <input type="radio" name="r.operationCode" value="000003"/>电信固话
 		<input id="nation" type="hidden" name="r.forceNation" <#if (r.forceNation)?default("")=="true">value="true"</#if>value="false"/>
        </div>
        <div style="position: absolute; top: 120px; left: 20px;">
            <span style="font-size:20px;">缴费金额:</span>
            <input type="text" id="faceValue" class="input" name="r.faceValue" <#if r??&&r.faceValue??>value="${(r.faceValue)!}" </#if> onblur="checkPrice();">
            元<span id="priceSpan" style="color: red;"></span>
            <br/>
            &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
            <input type="button" value="10">
            <input type="button" value="20">
            <input type="button" value="30">
            <input type="button" value="50">
            <input type="button" value="100">
        </div>
        <div style="position: absolute; top: 210px; left: 20px;">
            <span style="font-size:20px;">交易密码:</span>
            <input type="password" class="input" name="r.password" >
        </div>
        <div style="position: absolute; top: 260px; left:100px;">
            <input id="submits" type="submit" value="缴费" onclick="return submits();">
            <input id="resets"type="reset" value="重置">
            <input type="button" value="打印">
            <input type="button" value="历史记录">
        </div>
    </div>
</form>
</@edit>